//元数据的api
import request from "@/utils/request";
// let baseURL='http://192.168.1.72:8082'
// 新建元数据
export function addMetadataInfo(data) {
  return request({
    url: "/metadataInfo/addMetadataInfo",
    method: "post",
    data: data,
  });
}
// 获取数据源列表
export function getDataSourceName(data) {
  return request({
    url: "/dataSourceInfo/getDataSourceName",
    method: "get",
    data: data,
  });
}
// 查询元数据列表
export function fuzzyQueryPage(data) {
  return request({
    url: "/metadataInfo/fuzzyQueryPage",
    method: "post",
    data: data,
  });
}
// 删除元数据
export function deleteMetadataInfo(data) {
  return request({
    url: "/metadataInfo/deleteMetadataInfo",
    method: "delete",
    data: data,
  });
}
//修改元数据
export function editMetadataInfo(data) {
  return request({
    url: "/metadataInfo/editMetadataInfo",
    method: "put",
    data: data,
  });
}
//字段信息分页查询
export function pageQuery(query) {
  return request({
    url: "/metadataFieldInfo/getPage",
    method: "get",
    params: query,
  });
}
//新增模块
export function add(data) {
  return request({
    url: "/metadataModule/add",
    method: "post",
    data: data,
  });
}
//锁定 现在更改
export function isLock(query) {
  return request({
    url: "/metadataInfo/isLock",
    method: "get",
    params: query,
  });
}
//查询模块列表
export function getModuleList() {
  return request({
    url: "/metadataModule/getModuleList",
    method: "get",
  });
}
//删除元字段信息
export function deleteInfo(data) {
  return request({
    url: "/metadataFieldInfo/delete",
    method: "delete",
    data: data,
  });
}
//修改存储位置
export function editStoreLocation(data) {
  return request({
    url: "/metadataInfo/editStoreLocation",
    method: "post",
    data: data,
  });
}
//获取表头配置
export function getTableConfig() {
  return request({
    url: "/metadataFieldInfo/getTableConfig",
    method: "get",
  });
}
//修改动态表头
export function editTableHeader(data) {
  return request({
    url: "/metadataFieldInfo/editTableHeader",
    method: "put",
    data: data,
  });
}
//获取动态表头
export function getTableHeader(query) {
  return request({
    url: "/metadataFieldInfo/getTableHeader",
    method: "get",
    params: query,
  });
}
//添加元数据字段
export function Addfield(data) {
  return request({
    url: "/metadataFieldInfo/add",
    method: "post",
    data: data,
  });
}
//根据元数据id获取元数据字段列表
export function getMetadataFieldNameList(query) {
  return request({
    url: "/metadataFieldInfo/getMetadataFieldNameList",
    method: "get",
    params: query,
  });
}
//根据当前字段所属的原字段id获取其他元数据列表
export function getMetadataList(query) {
  return request({
    url: "/metadataFieldInfo/getMetadataList",
    method: "get",
    params: query,
  });
}
//获取精度
export function getPrecisionNum() {
  return request({
    url: "/metadataFieldInfo/getPrecisionNum",
    method: "get",
  });
}
//获取字段类型枚举

export function getFieldType() {
  return request({
    url: "/metadataFieldInfo/getFieldType",
    method: "get",
  });
}
//修改元数据字段
export function editFiled(data) {
  return request({
    url: "/metadataFieldInfo/edit",
    method: "put",
    data: data,
  });
}
//查询业务数据之前先去查元数据字段名
export function getMetadataVoListByMetadataId(query) {
  return request({
    url: "/metadataFieldInfo/getMetadataVoListByMetadataId",
    method: "get",
    params: query,
  });
}
//查询业务数据   
export function queryDataInfo(data) {
  return request({
    url: "/metadataInfo/queryData",
    method: "post",
    data: data,
  });
}
//获取时间字段类型枚举
export function getTimeFormatEnums() {
  return request({
    url: "/metadataFieldInfo/getTimeFormatEnums",
    method: "get",
  });
}